package logique.preferences;

import logique.reseau.Ville;

/**
 * 
 * @author camille
 *
 */
public abstract class CritereVille extends Critere {
	
	protected boolean favoriser;
	
	protected CritereVille(boolean favoriser){
		this.favoriser = favoriser;
	}
	
	public abstract double eval(Ville ville, int position, int nbCriteresTotal);
	
	protected double eval(double coef, int position, int nbCriteresTotal){
		if( favoriser ){
			return 1 * coef * ( 1.0 * position / (2.0*nbCriteresTotal) + 0.5 );
		}
		return 1 / coef * ( 1.0 * position / (2.0*nbCriteresTotal) + 1 );
	}
}
